import Util from "@/utils/Util";

export namespace UserInfo {
    export class SimpleUser {
        uid: number = 0;
        name: string = '';
        nick: string = '';
        head: string = '';
        sex: number = 1;
        phone: string = '';
        wx: string = '';
        followed: boolean = false;
        qrcode:string="";
    }


    export class DyUser {
        avatarUrl: string = '';
        nickName: string = '';
        gender: number = 1;
        city: string = '';
        province: string = '';
        country: string = '';
        language: string = '';
        encryptedData: String = '';
        iv: string = '';
        signature: string = '';
    }

    export class UserData extends SimpleUser {
        admin: number = 0;
        vipLevel: number = 0;
        salerLevel: number = 0;
        vipExpireTime: string = '';
        salerExpireTime: string = '';
        commission: number = 0;
        money: number = 0;
        score: number = 0;
        inviteCount: number = 0;
        loginDays = new Array<LoginDay>();
        signIn: boolean = false;
        postCount: number = 0; // 帖子数
        fansCount: number = 0; // 粉丝数
        followCount: number = 0; // 关注数
    }

    export class LoginDay {
        day: number = 0;
        commonScore: number = 0;
        vipScore: number = 0;
        select: boolean = false;
    }


    export class User extends UserData {
        uid: number = 0;
        wx: string = ''
        country: string = '';
        province: string = '';
        city: string = '';
        birthday: string = '1989-02-04';
        token: string = ''
        openId: string = '';
        qrcode: string = '';
        referrer: SimpleUser = null;
        refUid: number = 0;
        code: string = '';
        encryptedData: String = '';
        iv: string = '';
        signature: string = '';

        haveArchive() {
            return !Util.isEmpty(this.nick) && !Util.isEmpty(this.head);
        }

    }
}
